home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Replacements / cpdist_0_17.lha / cpdist-0.17 / source / msg.c < prev    next >
C/C++ Source or Header  |  1994-06-06  |  1KB  |  54 lines

  1. /*
  2.  *  MSG.C -- functions to print messages
  3.  */
  4.  
  5. /*
  6.  * (c)Copyright 1992-93 by Tobias Ferber.
  7.  *
  8.  * This file is part of CPDIST.
  9.  *
  10.  * CPDIST is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published
  12.  * by the Free Software Foundation; either version 1 of the License,
  13.  * or (at your option) any later version.
  14.  *
  15.  * CPDIST is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with CPDIST; see the file COPYING.  If not, write to
  22.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #include <stdarg.h>
  26. #include <stdio.h>
  27.  
  28. /* globals initialized by main() */
  29. char *whoami;
  30. FILE *ferr;
  31.  
  32.  
  33. void echo(const char *fmt, ...)
  34. { va_list argp;
  35.   va_start(argp,fmt);
  36.   fprintf(ferr,"%s: ",whoami);
  37.   vfprintf(ferr,(char *)fmt,argp);
  38.   fprintf(ferr,"\n");
  39.   fflush(ferr);
  40.   va_end(argp);
  41. }
  42.  
  43.  
  44. void lerror(int line, const char *fmt, ...)
  45. { va_list argp;
  46.   va_start(argp,fmt);
  47.   fprintf(ferr,"line %d: ",line);
  48.   vfprintf(ferr,(char *)fmt,argp);
  49.   fprintf(ferr,"\n");
  50.   fflush(ferr);
  51.   va_end(argp);
  52. }
  53.  
  54.